import montylingua3
import string

global m #a monty lingua instance. 
m = montylingua3.MontyLingua() #we only have to instantiate it once (...takes around 5 secs!)


def process_text(inputtext):
    """Given an input text, returns a sentence and tagged sentence tuple using monty lingua"""
    global m 

    sentences = m.split_sentences(inputtext)
    tokenized = map(m.tokenize,sentences)
    tagged = map(m.tag_tokenized,tokenized)

    #print "tagged: " + string.join(tagged,'\n         ')
    #chunked = map(m.chunk_tagged,tagged)
    #print "CHUNKED: " + string.join(chunked,'\n         ')
    #extracted = map(m.extract_info,chunked)

    return [sentences, tagged]
